package com.drop.service;

import com.drop.dao.CommonDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by 陈东一 on 2017/8/4 14:24
 */
@Service
@Transactional
public class CommonService {
	@Autowired
	CommonDao cd;

	public Object getById(Class cls, Integer id) {
		return cd.getById(cls, id);
	}

	public List<Object> getAll(Class cls) {
		return cd.getAll(cls);
	}

	public List<Object> getByPage(Class cls, Integer startNum, Integer pageNum) {
		return cd.getByPage(cls,startNum,pageNum);
	}

	public void update(Object obj) {
		cd.update(obj);
	}

	public void delete(Object obj) {
		cd.update(obj);
	}

	public void add(Object obj) {
		cd.add(obj);
	}

	public Integer count(Class cls) {
		return cd.count(cls);
	}

}
